namespace :db do
  task :backup do
    timestamp = Time.now.strftime('%Y%m%d%H%M%S')
    dirname = File.join 'backups', timestamp
    puts "Dump database to `#{dirname}'"
    ENV['dir'] = dirname
    Rake::Task['db:data:dump_dir'].invoke
  end
end
